/**
 * 
 */
package org.hotpotmaterial.code.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.Table;

import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import com.fasterxml.jackson.annotation.JsonProperty;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author wenxing
 *
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Table(name = "container_env")
@Entity
@EntityListeners(value = {AuditingEntityListener.class})
public class ContainerEnvPO extends BaseEntity {
  
  /**
   * serialVersionUID
   */
  private static final long serialVersionUID = -3454898268974827320L;

  /**
   * 发布配置id
   */
  @Column(name = "release_id")
  @JsonProperty("releaseId")
  private String releaseId;
  
  /**
   * 容器挂载路径
   */
  @Column(name = "name")
  @JsonProperty("name")
  private String name;
  
  /**
   * 挂载方式  bind/volume
   */
  @Column(name = "value")
  @JsonProperty("value")
  private String value;
  
  /**
   * 项目id
   */
  @Column(name = "project_id")
  @JsonProperty("projectId")
  private String projectId;
  
  /**
   * 更新属性
   * 
   * @param apiBasePO
   * @return
   */
  public ContainerEnvPO updateAttrs(ContainerEnvPO containerEnv) {
    this.releaseId = containerEnv.getReleaseId();
    this.name = containerEnv.getName();
    this.value = containerEnv.getValue();
    return this;
  }
}
